
#include "Int32.h"

#include <math.h>
#include <stdio.h>

// DEBUG.
#include "Debug.h"

using namespace Riccsson::System;

REGISTER_CLASS_CPP(Int32)
{

}

//---------------------------------------------------------------------------------------
int Int32::CompareTo(int* value)
{
	return _internalInt32 > *value ? 1 : _internalInt32 < *value ? -1 : 0;
}
//---------------------------------------------------------------------------------------
int Int32::CompareTo(object* value)
{
	if (!(instanceof(value, Int32)))
		return false;

	return ((Int32*)value)->_internalInt32 == _internalInt32;
}
//---------------------------------------------------------------------------------------
bool Int32::Equals(int* obj)
{
	return _internalInt32 == *obj;
}
//---------------------------------------------------------------------------------------
bool Int32::Equals(object* obj)
{
	if (!(instanceof(obj, Int32)))
		return false;

	return ((Int32*)obj)->_internalInt32 == _internalInt32;
}
//---------------------------------------------------------------------------------------
int Int32::GetHashCode()
{
	return _internalInt32;
}
//---------------------------------------------------------------------------------------
TypeCode Int32::GetTypeCode()
{
	throw;
}
//---------------------------------------------------------------------------------------
// Static.
int Int32::Parse(string* s)
{
	throw;
}
//---------------------------------------------------------------------------------------
// Static.
int Int32::Parse(string* s, IFormatProvider* provider)
{
	throw;
}
//---------------------------------------------------------------------------------------
// Static.
int Int32::Parse(string* s, Globalization::NumberStyles style)
{
	throw;
}
//---------------------------------------------------------------------------------------
// Static.
int Int32::Parse(string* s, Globalization::NumberStyles style, IFormatProvider* provider)
{
	throw;
}
//---------------------------------------------------------------------------------------
GC_PTR<Riccsson::System::string> Int32::ToString()
{
	char str[32];
#pragma warning( push )
#pragma warning( disable : 4996)
	sprintf(str, "%d", this->_internalInt32);
#pragma warning( pop )

	GC_PTR<string> output( new string(str) );

	return output;
}
//---------------------------------------------------------------------------------------
GC_PTR<Riccsson::System::string> Int32::ToString(IFormatProvider* provider)
{
	throw;
}
//---------------------------------------------------------------------------------------
GC_PTR<Riccsson::System::string> Int32::ToString(string* format)
{
	throw;
}
//---------------------------------------------------------------------------------------
GC_PTR<Riccsson::System::string> Int32::ToString(const char* format)
{
	throw;
}
//---------------------------------------------------------------------------------------
GC_PTR<Riccsson::System::string> Int32::ToString(string* format, IFormatProvider* provider)
{
	throw;
}
//---------------------------------------------------------------------------------------
// Static.
bool Int32::TryParse(string* s, int out result)
{
	throw;
}
//---------------------------------------------------------------------------------------
// Static.
bool Int32::TryParse(string* s, Globalization::NumberStyles style, IFormatProvider* provider, int out result)
{
	throw;
}




//----------------------------------------------------------------------------
// +
Int32 Int32::operator+ ( const Int32 value )
{
	return Int32(this->_internalInt32 + value._internalInt32);
}

//----------------------------------------------------------------------------
// -
Int32 Int32::operator- ( const Int32 value )
{
	return Int32(this->_internalInt32 - value._internalInt32);
}

//----------------------------------------------------------------------------
// *
Int32 Int32::operator* ( const Int32 value )
{
	return Int32(this->_internalInt32 * value._internalInt32);
}

//----------------------------------------------------------------------------
// /
Int32 Int32::operator/ ( const Int32 value )
{
	return Int32(this->_internalInt32 / value._internalInt32);
}
Int32 Int32::operator/ ( const int& value )
{
	return Int32(this->_internalInt32 / value);
}

//----------------------------------------------------------------------------
// %
Int32 Int32::operator% ( const Int32 value )
{
	return Int32(this->_internalInt32 % value._internalInt32);
}